Skip to content

Conversation

@pguyot
Copy link
Collaborator

@pguyot pguyot commented Nov 1, 2025

Useful for defining a start module that doesn't have start/0 (but main/1).

Copy link
Collaborator

@UncleGrumpy UncleGrumpy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but can we add a test for specifying a start_module that uses main/1 and assert that the packed avm has the correct module tagged as the start module?

Useful for defining a start module that doesn't have start/0 (but main/1).

Signed-off-by: Paul Guyot <[email protected]>
@pguyot pguyot force-pushed the w44/start-module-precedence branch from 1ad714c to bb6c95c Compare November 16, 2025 21:01
@pguyot pguyot requested a review from UncleGrumpy November 16, 2025 22:07
Copy link
Collaborator

@UncleGrumpy UncleGrumpy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the test. I feel much better now about future changes not breaking anything. I did catch one other small detail I overlooked during my first review.

Copy link
Collaborator

@UncleGrumpy UncleGrumpy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wrong about wanting a check there. After looking at atomvm/AtomVM#1984 and seeing that Gleam seems to prefer main/0, I think we should support that as an entry point in AtomVM and not do any checks here. There may be other start functions needed for other scenarios, so we should allow any module and not care about which functions are exported.

@UncleGrumpy UncleGrumpy merged commit 4de8162 into atomvm:master Nov 17, 2025
6 checks passed
@pguyot pguyot deleted the w44/start-module-precedence branch November 17, 2025 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants